#ifndef SERIAL_H
#define SERIAL_H

#include <QThread>

class Serial : public QThread
{
    Q_OBJECT

signals:
    void signalReadyRead(quint8 c);
public:
    explicit Serial(QThread *parent = 0);
    ~Serial();
    void beginSerial();
    void stopSerial();
    char recvData();
    void sendData(quint8 c);
    void sendString(QString str);

protected:
    void run();

private:
    bool m_isExit;
    int usart_fd;
};

#endif // SERIAL_H
